package com.taomus.mytools.simplec;

import java.io.File;
import java.io.FileInputStream;
import java.util.LinkedList;

import com.taomus.mytools.simplec.common.SyntaxTuple;
import com.taomus.mytools.simplec.common.SyntaxTupleList;
import com.taomus.mytools.simplec.utils.FileStreamUtils;
import com.taomus.mytools.simplec.utils.Tools;

public class Main {

	public static void main(String[] args) throws Exception {
		String path = System.getProperty("user.dir") + "/source/test.sc";
		String text = FileStreamUtils.getInputStreamContent(new FileInputStream(new File(path)));
		Syntax s = new Syntax();
		s.analyse(text);
		LinkedList<SyntaxTuple> syntaxTupleList = SyntaxTupleList.tupleList;
		syntaxTupleList = ScaningSytaxTuple.getInstance().scaning(syntaxTupleList);
		Tools.println(syntaxTupleList);
/*
		Compiler c = new Compiler();
		Class<?> zlass = c.compiler(syntaxTupleList);
		Object obj = zlass.newInstance();
		zlass.getMethod("c", (new Object[0]).getClass()).invoke(obj, new Object[] { new Object[] { 0 } });
*/
	}
}
